<template>
	<view class="isAgree">
		<view class="agree-area">
			<u-checkbox-group @change="checkBoxChanage">
				<u-checkbox v-model="item.checked" v-for="(item, index) in list" :key="index" :name="item.name">
					<view class="checkBoxName">
						<text class="agree-text">选中及代表同意</text>
						<text class="agree-text navigator" @click="navTo('/pages/webview/wb?src=https://www.haskills.com/yhsc_service.html')">用户协议</text>
						<text class="agree-text">和</text>
						<text class="agree-text navigator" @click="navTo('/pages/webview/wb?src=https://www.haskills.com/yhsc_secret.html')">隐私政策</text>
					</view>
				</u-checkbox>
			</u-checkbox-group>
		</view>
		<text class="footer-text">适用范围：本应用程序仅限进销存渠道使用</text>
	</view>
</template>

<script>
import { navTo } from '@/common/utils.js';
export default {
	name: 'agree',
	data() {
		return {
			list: [
				{
					name: 'agree',
					checked: false
				}
			]
		};
	},
	methods: {
		navTo,
		checkBoxChanage(e) {
			console.log('value =================> ', e.length);
			this.$emit('change', e.length > 0);
		}
	}
};
</script>

<style scoped lang="scss">
.isAgree {
	margin-top: 40rpx;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;

	.agree-area {
		display: flex;
		align-items: center;
		justify-content: center;

		.checkBoxName {
			width: auto;
			display: flex;
			align-items: center;
		}
	}

	.agree-text {
		margin: 0 5rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
	}

	.navigator {
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
	}

	.footer-text {
		margin: 15rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
	}
}
</style>
